package com.seckill.system.api;

import com.seckill.common.core.constant.ServiceNameConstants;
import com.seckill.system.api.domain.Order;
import com.seckill.system.api.factory.RemoteFileFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "remoteOrderService", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
public interface RemoteOrderService {

    @PostMapping("/order/save")
    public Long save(@RequestBody Order order);

    @GetMapping("/order/findbyuseridandskuid")
    public boolean findbyuseridandskuid(@RequestParam("skuId") Long skuId,@RequestParam("userId") Long userId);
}
